<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>添加方案编制单位</title>
<link rel="stylesheet" type="text/css" href="../css/blueprint/screen.css" media="screen, projection"/>
<script type="text/javascript" src="../script/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
    $(document).ready(function() {

        loadTempSavedData();

        $("#tempSave").click(function() {
            $.getJSON("AddPlanTempSaveFABZDW.action", 
                {
                    "tdfkfaComposeUnit.cuName": escape($("#cuName").val()),
                    "tdfkfaComposeUnit.cuContact": $("#cuContact").val(),
                    "tdfkfaComposeUnit.cuPhone": $("#cuPhone").val()
                },
                function(data) {
                    if (data.tempSaveStatus == "success") {
                        $(parent.LeftFrame.document).contents().find("#tempDataSaver").val("success");
                    } else if (data.tempSaveStatus == "failed") {
                        $(parent.LeftFrame.document).contents().find("#tempDataSaver").val("failed");
                    }
                }
            );
        });
    });
    function loadTempSavedData() {
        $.getJSON("AddPlanTempLoadFABZDW.action", 
            function(data) {
                if (data.tdfkfaComposeUnit != null) {
                    $("#cuName").val(unescape(data.tdfkfaComposeUnit.cuName));
                    $("#cuContact").val(data.tdfkfaComposeUnit.cuContact);
                    $("#cuPhone").val(data.tdfkfaComposeUnit.cuPhone);
                }
                
                watchDataEdited();
            }
        );
    }
    function watchDataEdited() {
    	$("input[type='text'],input[type='radio'],input[type='checkbox']").change(function() {
            $(parent.LeftFrame.document).contents().find("#dataEditWatcher").val("changed");
            $(parent.LeftFrame.document).contents().find("#tempDataSaver").val("");
        });
    }
</script>
<style type="text/css">
<!--
.style1 {font-size: 36px}
-->
</style>
</head>
<body>
<table width="100%" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td width="20%" colspan="4"><div align="center" class="style1">
          <p><strong>方案编制单位</strong></p>
		  <hr></hr>
        </div></td>
    </tr>
    <tr>
        <td width="20%" height="25" align="right">单位名称：</td>
        <td width="30%"><input type="text" name="cuName" id="cuName"/></td>
        <td width="20%" align="right">联系人：</td>
        <td width="30%"><input type="text" name="cuContact" id="cuContact"/></td>
    </tr>
    <tr>
        <td width="20%" height="25" align="right">联系电话：</td>
        <td width="30%"><input type="text" name="cuPhone" id="cuPhone"/></td>
        <td width="20%">&nbsp;</td>
        <td width="30%">&nbsp;</td>
    </tr>
    <tr>
        <td height="25" width="20%"><div align="right"><input type="button" id="tempSave" value="暂存" /></div></td>
        <td width="30%">&nbsp;</td>
        <td height="25" width="20%">&nbsp;</td>
        <td width="30%">&nbsp;</td>
    </tr>
</table>
</body>
</html>